<?php
declare (strict_types = 1);

namespace app\system\controller;

use app\system\BaseController;
use app\system\service\WechatUserService;
use think\App;
use think\Request;

class WechatUser extends BaseController
{

    private WechatUserService $service;

    public function __construct(App $app)
    {
        $this->service = new WechatUserService();
        parent::__construct($app);
    }

    /**
     * 显示资源列表
     *
     * @return \think\Response
     */
    public function index()
    {
        return $this->success($this->service->getList($this->request->get()));
    }

    /**
     * 显示创建资源表单页.
     *
     * @return \think\Response
     */
    public function create()
    {
        //
    }

    /**
     * 显示指定的资源
     *
     * @param  int  $id
     * @return \think\Response
     */
    public function read($id)
    {
        //
    }

    /**
     * 保存更新的资源
     *
     * @param  \think\Request  $request
     * @param  int  $id
     * @return \think\Response
     */
    public function update($id)
    {
        $data = $this->request->put();
        return $this->success($this->service->update($id, $data));
    }

    /**
     * 删除指定资源
     *
     * @param  int  $id
     * @return \think\Response
     */
    public function delete($id)
    {
        //
    }
}
